#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QTableWidget>
#include <QTableWidgetItem>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    ui->tableWidget->setColumnCount(3);

    ui->tableWidget->setHorizontalHeaderLabels(QStringList() << "姓名" << "性别" << "电话号码");
    ui->tableWidget->setRowCount(10);

    QTableWidgetItem *newit = new QTableWidgetItem("张三");
    ui->tableWidget->setItem(0, 0, newit);
}

MainWindow::~MainWindow()
{
    delete ui;
}

